﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using OrganizedIN.BAL;
using OrganizedIN.BussinessServices;

namespace OrganizedIN.UI.AccountSetting
{
    public partial class PaymentSetting : System.Web.UI.Page
    {
        BLL oibll = new BLL();        
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                fillInformation();
            }
            catch (Exception ex)
            {
            }
        }
        private void fillInformation()
        {
            string username = Session["UserID"].ToString();
            PaymentSet ObjPs = oibll.GetCreditCardNo(username);
            txtcardorder.Text = ObjPs.CreaditCard_No;
            drpmonth.Items.Insert(0, ObjPs.Expiration_Month);
            drpyear.Items.Insert(0, ObjPs.Expiration_Year);
        }
        protected void btnsubmit_Click(object sender, EventArgs e)
        {
            try
            {
                PaymentSet objpayment = new PaymentSet();
                if (txtcardorder.Text != "")
                {
                    objpayment.CreaditCard_No = txtcardorder.Text;
                    objpayment.Expiration_Month = drpmonth.Text.Trim();
                    objpayment.Expiration_Year = drpyear.Text.Trim();
                    objpayment.price = Convert.ToString(0);
                    objpayment.Paypal = Convert.ToString(0);
                    objpayment.Fromdate = DateTime.Now;
                    objpayment.user_name = Session["UserID"].ToString();
                    oibll.PaymentSettingInsert(objpayment);
                    txtcardorder.Text = "";
                    lblerrmsg.Text = "Insert Successfully..";
                }
            }
            catch (Exception ex)
            {
            }
        }
    }
}
